<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{$meta_title}</h2>
	</div>
	<div class="cf">
		<div class="fl">
			<button class="btn ajax-post confirm" url="{:U('delrec')}" target-form="ids">删除文件</button>
		</div>
	</div>
    <!-- 数据列表 -->
	<div class="data-table table-striped">
		<table class="">
			<thead>
				<tr>
					<th class="row-selected"><input class="check-all" type="checkbox"/></th>
					<th>文件名称</th>
					<th>文件类别</th>
					<th>发布用户</th>
					<th>已阅</th>
					<th>发布时间</th>
					<th>首次下载时间</th>
					<th>操作</th>
				</tr>
			</thead>
		    <tbody>
			<notempty name="_list">
				<volist name="_list" id="vo">
				<tr>
					<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
					<td>{$vo.title}</td>
					<td>{$vo.category|get_cabinet_category}</td>
					<td>{:get_nickname($vo['uid'])}</td>
					<td>{$vo['readed']?'是':'否'}</td>
					<td>{$vo.pub_time|time_format}</td>
					<td>{$vo.read_time|time_format}</td>
					<td>
						<a class="ajax-get" href="{:U('transfer?id='.$vo['id'])}">转存</a>
						<a href="{:U('download?id='.$vo['id'])}">下载</a>
						<a class="ajax-get confirm" href="{:U('delrec?id='.$vo['id'])}">删除</a>
					</td>
				</tr>
				</volist>
			<else/>
				<tr>
					<td colspan="8" class="text-center"> aOh! 暂时还没有内容! </td>
				</tr>
			</notempty>
			</tbody>
		</table>
	</div>
	<!-- 分页 -->
	<div class="page">
		{$_page}
	</div>
</block>

<block name="script">
<script type="text/javascript">
	$("#search").click(function(){
		var url = $(this).attr('url');
		var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
</script>
</block>